﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Data.OleDb;

public partial class android_getNews : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        DataTable dt = DB.getDataTable("select * from news where isread<>'1' or isread is null");
        String result = "{\"list\":[";
        if (dt != null && dt.Rows.Count > 0)
        {
            for (int i = 0; i < dt.Rows.Count; i++)
            {
                result += "{\"title\":\"" + dt.Rows[i]["title"].ToString() + "\",\"content\":\"" + StringUtil.StripHTML(dt.Rows[i]["content"].ToString()).Replace("\"","“") + "\"}";

                if (i < dt.Rows.Count - 1 )
                {
                    result += ",";
                }
            }
        }
        result += "]}";
        Response.Write(result);
    }
}